/**
 * 
 */
package com.vivid.dynamics.oknow.model;

import java.sql.Timestamp;

/**
 *
 * @author jason
 * created at:: Jul 27, 2011 5:22:14 PM
 */
public class BookmarkHitHistory {
	private int id;
	private int bookmarkId;
	private int userId;
	private java.sql.Timestamp hitDate;
	private int rate;
	private int star;
	
	// TODO add back associations
	
	/**
	 * ctor.
	 */
	protected BookmarkHitHistory() {}
	
	/**
	 * <b>PS</b>. a MUST for hibernate entities, or you will have problems 
	 * during association methods; simply you can't remove / update the correct
	 * logical Entity in your collections<p/>
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		/*
		result = prime * result + bookmarkId;
		result = prime * result + ((hitDate == null) ? 0 : hitDate.hashCode());
		result = prime * result + rate;
		result = prime * result + star;
		result = prime * result + userId;
		*/
		return result;
	}

	/**
	 * <b>PS</b>. a MUST for hibernate entities, or you will have problems 
	 * during association methods; simply you can't remove / update the correct
	 * logical Entity in your collections<p/>
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BookmarkHitHistory other = (BookmarkHitHistory) obj;
		if (bookmarkId != other.bookmarkId)
			return false;
		if (hitDate == null) {
			if (other.hitDate != null)
				return false;
		} else if (!hitDate.equals(other.hitDate))
			return false;
		if (id != other.id)
			return false;
		if (rate != other.rate)
			return false;
		if (star != other.star)
			return false;
		if (userId != other.userId)
			return false;
		return true;
	}

	/**
	 * ctor.
	 * @param bookmarkId
	 * @param userId
	 * @param hitDate
	 * @param rate
	 * @param star
	 */
	public BookmarkHitHistory(int bookmarkId, int userId, Timestamp hitDate,
		int rate, int star) {
		super();
		this.bookmarkId = bookmarkId;
		this.userId = userId;
		this.hitDate = hitDate;
		this.rate = rate;
		this.star = star;
	}

	/* ********************** */
	/* *  accessor/mutator  * */
	/* ********************** */
	
	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Jul 27, 2011  5:25:15 PM
	 */
	public int getBookmarkId() {
		return bookmarkId;
	}
	public void setBookmarkId(int bookmarkId) {
		this.bookmarkId = bookmarkId;
	}

	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Jul 27, 2011  5:25:28 PM
	 */
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}

	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Jul 27, 2011  5:25:33 PM
	 */
	public java.sql.Timestamp getHitDate() {
		return hitDate;
	}
	public void setHitDate(java.sql.Timestamp hitDate) {
		this.hitDate = hitDate;
	}

	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Jul 27, 2011  5:25:37 PM
	 */
	public int getRate() {
		return rate;
	}
	public void setRate(int rate) {
		this.rate = rate;
	}

	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Jul 27, 2011  5:25:41 PM
	 */
	public int getStar() {
		return star;
	}
	public void setStar(int star) {
		this.star = star;
	}

	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Jul 27, 2011  5:25:45 PM
	 */
	public int getId() {
		return id;
	}
	protected void setId(int pId) {
		this.id=pId;
	}
}
